package com.lili.collection.core.runner.result;

import lombok.Data;

/**
 *描述: 采集记录信息
 *@date:2023/4/27  16:31
 *@author:lili
 */
@Data
public class RecordInfo {
    //总记录数
    private int totalRecordCount=0;
    //成功记录数
    private int successRecordCount=0;
    //失败记录数
    private int errorRecordCount=0;
    //采集是否成功
    private boolean successed=true;
    //采集错误信息
    private ErrOutputData errOutputData = new ErrOutputData();

    public void addErrorValueDetail(ErrorDetail errorDetail) {
        errOutputData.addErrorValueDetail(errorDetail);
    }

    public void incrementTotalCount(){
        totalRecordCount++;
    }

    public void addTotalCount(int count){
        totalRecordCount+=count;
    }

    public void incrementSuccessCount(){
        successRecordCount++;
    }

    public void addSuccessCount(int count){
        successRecordCount+=count;
    }

    public void incrementErrorCount(){
        errorRecordCount++;
    }

    public void addErrorCount(int count){
        successed=false;
        errorRecordCount+=count;
    }
}